import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    redirect:"/films/nowPlaying"
  },
  {
    path: '/films',
    name: 'Films',
    component:() => import('../views/Films'),
    meta:{
      isNav:true
    },
    children:[
      {
        path: 'nowPlaying',
        component:() => import('../views/Films/components/HotMovie.vue'),
        meta:{
          isNav:true
        }
      },
      {
        path: 'soon',
        component:() => import('../views/Films/components/SoonMovie.vue'),
        meta:{
          isNav:true
        }
      },
    ]
  },
  {
    path: '/article',
    name: 'Article',
    component: () => import('../views/Article'),
    meta:{
      isNav:true
    }
  },
  {
    path: '/article/:id',
    name:'ArticleDetail',
    component:() => import('../views/Article/ArticleDetail.vue')
  },
  {
    path: '/center',
    name:'Center',
    component:() => import('../views/Center'),
    meta:{
      isNav:true
    }
  },
  {
    path: '/film/:id',
    name:'MovieDetail',
    component:() => import('../views/Films/MovieDetail.vue')
  },
  {
    path:"/city",
    name:'City',
    component:()=> import('../views/City')
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
